﻿using MockSchoolManagement.Core.Repositories;
using MockSchoolManagement.Domain.Students;
using System.Collections.Generic;
using System.Linq;

namespace MockSchoolManagement.Application
{
    public class StudentService:IStudentService
    {
        private readonly IRepository<Student, int> _repository;

        public StudentService(IRepository<Student, int> repository)
        {
            _repository = repository;
        }

        public List<Student> GetStudentByPage(int page = 1, int pageSize = 10)
        {
            return _repository.GetAllList().Skip((page - 1) * pageSize).Take(pageSize).ToList();
        }
    }
}
